<template>
   <div>
    <h3>User---{{userId}}</h3>
    <!--取法2-->
    <p>{{$route.params.userId}}</p>
   </div>
</template>

<script>
export default {
  name: 'User',
  computed: {
    userId(){
      // 取法1
      return this.$route.params.userId
    }
  }
}
</script>

<!-- Add "scoped" attribute to limit CSS to this component only -->
<style scoped>
 
</style>
